//
//  WJUIButtonEX.m
//  MachTalkWarm
//
//  Created by 王军 on 16/3/25.
//  Copyright © 2016年 王军. All rights reserved.
//

/***
 小按钮不容易点，对系统按钮做的扩展，重写了hitTest函数，增加响应区域
 ***/

#import "WJUIButtonEX.h"

@implementation WJUIButtonEX

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    if (self.isHidden) {
        return nil;
    }
    CGRect rectBig = CGRectInset(self.bounds, -(self.extraWidth/2), -(self.extraHeight/2));
    if (CGRectContainsPoint(rectBig, point)) {
        return self;
    }else{
        return nil;
    }
    return self;
}

@end
